#include <iostream>
#include <SFML/Graphics.hpp>

int main() {
    // 创建窗口
    sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML Triangle Example");

    // 创建三角形
    sf::ConvexShape triangle;
    triangle.setPointCount(3);
    triangle.setPoint(0, sf::Vector2f(400, 100));
    triangle.setPoint(1, sf::Vector2f(100, 500));
    triangle.setPoint(2, sf::Vector2f(700, 500));
    triangle.setFillColor(sf::Color::Green);

    window.clear();
    window.draw(triangle);
    window.display();

    while (const std::optional event = window.waitEvent())
    {
        if (!event->is<sf::Event::Closed>()) continue;
        window.close();
        return 0;
    }
}
